/**************************************************************************
 *
 *        Copyright (c) 2007-2008 by Sunplus mMedia Inc., Ltd.
 *
 *  This software is copyrighted by and is the property of Sunplus
 *  mMedia Inc., Ltd. All rights are reserved by Sunplus mMedia
 *  Inc., Ltd. This software may only be used in accordance with the
 *  corresponding license agreement. Any unauthorized use, duplication,
 *  distribution, or disclosure of this software is expressly forbidden.
 *
 *  This Copyright notice MUST not be removed or modified without prior
 *  written consent of Sunplus mMedia Inc., Ltd.
 *
 *  Sunplus mMedia Inc., Ltd. reserves the right to modify this
 *  software without notice.
 *
 *  Sunplus mMedia Inc., Ltd.
 *  19-1, Innovation First Road, Science-Based Industrial Park,
 *  Hsin-Chu, Taiwan, R.O.C.
 *
 **************************************************************************/
/**
 * @file		hal_front.h
 * @brief		hal front header file.
 * @author		Matt Wang
 * @since		2008-09-08
 * @date		2008-12-09
 */

#ifndef __HAL_FRONT_H__
#define __HAL_FRONT_H__

/**************************************************************************
 *                              C O N S T A N T S
 **************************************************************************/
typedef enum {
	HAL_FRONT_PARA_MCLK_CFG,
	HAL_FRONT_PARA_PCLK_CFG,
	HAL_FRONT_PARA_SYNC_INVERT_ENABLE,
	HAL_FRONT_PARA_RESHAPE_ENABLE,
	HAL_FRONT_PARA_RESHAPE_REGION,
	HAL_FRONT_PARA_CROP_REGION,
	HAL_FRONT_PARA_FRONT_TO_CDSP_GATING_ENABLE,
	HAL_FRONT_PARA_TG_TOTAL_REGION,
	HAL_FRONT_PARA_TG_SYNC_GENERATOR_ENABLE,
	HAL_FRONT_PARA_YUV_OUTPUT_SEQUENCE_CFG,
	HAL_FRONT_PARA_YUV_CCIR_MODE,
	HAL_FRONT_PARA_YUV_SUB128_ENABLE,
	HAL_FRONT_PARA_YUV_INPUT_ENABLE,
	HAL_FRONT_PARA_MAX_ID,
} HAL_FrontParaId_e;

typedef enum {
	HAL_FRONT_YUV_OUTPUT_UYVY = (0 << 0),
	HAL_FRONT_YUV_OUTPUT_YVYU = (1 << 0),
	HAL_FRONT_YUV_OUTPUT_VYUY = (2 << 0),
	HAL_FRONT_YUV_OUTPUT_YUYV = (3 << 0),
} HAL_FrontYuvOutputSeqCfg_e;

typedef enum {
	HAL_FRONT_YUV_CCIR601 = (0 << 4),
	HAL_FRONT_YUV_CCIR656 = (1 << 4),
} HAL_FrontYuvCcirMode_e;

typedef enum {
	HAL_FRONT_MCLK_SRC_INT = (0 << 2),
	HAL_FRONT_MCLK_SRC_EXT = (1 << 2),
} HAL_FrontMclkSrc_e;

typedef enum {
	HAL_FRONT_PCLK_SRC_INT = (0 << 3),
	HAL_FRONT_PCLK_SRC_EXT = (1 << 3),
} HAL_FrontPclkSrc_e;

typedef enum {
	HAL_FRONT_WAIT_HSYNC  = (1 << 0),
	HAL_FRONT_WAIT_VSYNC  = (1 << 1),
	HAL_FRONT_WAIT_HVALID = (1 << 2),
	HAL_FRONT_WAIT_VVALID = (1 << 3),
} HAL_FrontWaitSource_e;

typedef enum {
	HAL_FRONT_WAIT_FALLING = 0,
	HAL_FRONT_WAIT_RISING  = 1,
	HAL_FRONT_WAIT_HIGH    = 2,
	HAL_FRONT_WAIT_LOW     = 3,
} HAL_FrontWaitMode_e;

/**************************************************************************
 *                  F U N C T I O N   D E C L A R A T I O N S
 **************************************************************************/
/* hal_front.c */
void HAL_FrontReset(void);
void HAL_FrontParaMclkCfgGet(UINT8 *psrc, UINT16 *pdiv, UINT8 *pphase, UINT8 *pdrv, UINT8 *pupd);
void HAL_FrontParaPclkCfgGet(UINT8 *psrc, UINT16 *pdiv, UINT8 *pphase);
UINT8 HAL_FrontSignalWait(UINT8 src, UINT8 mode, UINT8 num);

/* hal_front_para.c */
UINT8 HAL_FrontParaSet(UINT8 id, SINT16 para1, SINT16 para2, SINT16 para3, SINT16 para4, UINT8 upd);

#endif  /* __HAL_FRONT_H__ */

